const BtClients = require('./index')

async function main() {
    const client = BtClients.getClient({
        id: '2', 
        name: 'TR',
        type: 'transmission',
        address: 'http://192.168.88.48:9091',
        loginname: 'admin',
        loginpwd: 'admin'
    })
    const torrents = await client.listTorrents()
    console.log(torrents.map(t=>t.hashString))
    const torrent = await client.getTorrent('8bb7855f7b68e3a194f75f3e216c2e02bfd279eb')
    console.log(torrent.id, torrent.name)
}

async function second() {
    const client = BtClients.getClient({
        id: '2'
    })
    
    const torrent = await client.getTorrent('909551b366eddd58f2d24b3404c433ddf2923984')
    console.log(torrent.id, torrent.name)
}


async function test() {
    await main()
    await second()
}

test()